import { createApp } from 'vue'
import {createRouter,createWebHashHistory} from "vue-router";
import './style.css'
import App from './App.vue'
import Home from "./pages/home.vue";
import Pay from "./pages/pay.vue";
import diTails from "./pages/diTails.vue";
import inFormation from "./pages/inFormation.vue";
import Shopping from "./pages/shopping.vue";
import comMunity from "./pages/comMunity.vue";
import index from "./pages/index.vue";

const routes = [
    { path: '/', component: index ,children:[
            {
                path:'home',
                component:Home,
            },{
                path:'community',
                component:comMunity,
            },{
                path:'shopping',
                component:Shopping,
            },
        ]},
    { path: '/pay', component: Pay },
    { path: '/ditalis', component: diTails },
    { path: '/information', component: inFormation },
]
//3实例化路由
const router = createRouter({
    // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
    history: createWebHashHistory(),
    routes, // `routes: routes` 的缩写
})

//4 挂载路由
createApp(App).use(router).mount('#app')